﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using System.Data.SqlClient;
using DataAccess.SqlClient;
using Model;
using ApiDAL.Common;
using ApiDAL.Common;



namespace Dal
{
    public class UsertDAL
    {
        /// <summary>
        /// 注册
        /// </summary>
        /// <param name="account"></param>
        /// <param name="pwd"></param>
        /// <param name="name"></param>
        /// <param name="addr"></param>
        /// <param name="tel"></param>
        /// <returns></returns>
        public int Regin(string account, string pwd, string name, string addr, string tel)
        {
            SqlQuery sql = new SqlQuery();
            sql.CommandText = "Login";
            sql.CommandType = CommandType.StoredProcedure;
            SqlParameter cc = new SqlParameter();
            cc.Value = account;
            cc.ParameterName = "@account";
            sql.Parameters.Add(cc);
            SqlParameter cc1 = new SqlParameter();
            cc.Value = pwd;
            cc.ParameterName = "@pwd";
            sql.Parameters.Add(cc1);
            SqlParameter cc2 = new SqlParameter();
            cc.Value = name;
            cc.ParameterName = "@name";
            sql.Parameters.Add(cc2);
            SqlParameter cc3 = new SqlParameter();
            cc.Value = addr;
            cc.ParameterName = "@addr";
            sql.Parameters.Add(cc3);
            SqlParameter cc4 = new SqlParameter();
            cc.Value = tel;
            cc.ParameterName = "@tel";
            sql.Parameters.Add(cc4);
            int i = Convert.ToInt32(SqlDataAccess.ExecScalar(sql));
            return i;
        
             
        }



    }
}
